package com.zmn.brs.model.query.record;

import com.alibaba.fastjson.JSONObject;
import com.zmn.brs.model.vo.rule.objective.ObjectiveRuleVO;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;

/**
 * 描述：绩效监控查询
 * @author chongw
 * @since 2021-06-01 11:04
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ObjectiveRecordCustom {

    private Integer recordId;

    private Integer eventId;

    private Integer eventCode;

    private String eventName;

    private String monitorCycleTime;

    private Integer level;

    private String executionDesc;

    private Date createTime;

    private String expand;

    private String thresholdValue;

    private ObjectiveRuleVO data;

    public ObjectiveRuleVO getData(){
        try {
            return JSONObject.parseObject(this.thresholdValue , ObjectiveRuleVO.class);
        }catch (Exception e){
            return ObjectiveRuleVO.builder().build();
        }
    }

}
